package com.kikikeji;

import android.app.Activity;

import com.kikikeji.weizhuo.activity.core.ActivityStatusHelper;
import com.kikikeji.weizhuo.activity.core.ActivityStatusIntf;
import com.kikikeji.weizhuo.util.AppCache;

/**
 * Created by zhang on 2016/12/4.
 */
public class WeiZhuo {

    private Activity mCurActivity;
    private AppCache mAppCache;
    /**
     * 记录根Activity的类名，用于处理ActivityStack逻辑；
     */
    private String mRootActivity;

    private static class SingletonHolder {

        private static final WeiZhuo mInstance = new WeiZhuo();
    }

    public static WeiZhuo getInstance() {
        return SingletonHolder.mInstance;
    }

    public void setCurActivity(Activity act) {
        mCurActivity = act;
    }

    public Activity getCurActivity() {
        return mCurActivity;
    }

    public ActivityStatusIntf getActivityStatusManager() {

        return new ActivityStatusHelper();
    }

    public synchronized AppCache getAppCache() {
        if(null == mAppCache) {
            mAppCache = new AppCache();
        }
        return mAppCache;
    }

    public String getRootActivity() {
        return mRootActivity;
    }

    public void setRootActivity(String rootActivity) {
        this.mRootActivity = rootActivity;
    }

}
